﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{


    public partial class College : Form
    {

       

        //para may paglagayan mamaya yung main form para pag nag back ako ulit later
        Form home = null;
        string username = null;
        int checker = 0;

        public College(Form back,string _username)
        {
            
            // put sa isang var yung naunang form para may matatawag ako pag gusto ko na bumalik
            home = back;
            username = _username;
       
            InitializeComponent();

            //get the username from the sign in page
            

            //store na sa mga variables yung need na mga data mula sa database dito
            //para gamitin mamaya sa pag didisplay ng stuff

            //uncomment the code below tapos ilagay dun kung anong user type yung tao
            //string usertype = "     ";

            // if (usertype == "college")
            // {
            //     showpanel_college.Show();
            // }
            // else if(usertype == "organization")
            // {
            //      showpanel_organization.Show(); 
            // }
            // else
            // {
            //      showpanel_department.Show();
            // }
                

            
        }

        private void mail_Click(object sender, EventArgs e)
        {
            message_college.Show();
        }

        private void back_Click(object sender, EventArgs e)
        {
            message_college.Hide();
        }

        private void createproject_Click(object sender, EventArgs e)
        {
            create_college.Show();
        }

        private void passproject_Click(object sender, EventArgs e)
        {
            //lagay na sa db for approval
            if (MessageBox.Show("Are you sure with this project details?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                MessageBox.Show("Project added! please wait for approval");
                create_college.Hide();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you really want to cancel creating the project?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                create_college.Hide();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you really done editing your account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //kunin laman nung mga txt box tapos lagay na sa db. preferably yung function call lang lalagay dito
                edit_college.Hide();
                show_college.Show();
            }
        }

        private void edit_Click(object sender, EventArgs e)
        {
            show_college.Hide();
            edit_college.Show();
        }

        private void deleteaccount_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure deleting your account?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                //delete na yung account sa db. preferably yung function call lang lalagay dito
                MessageBox.Show("Account successfully deleted!");
                edit_college.Hide();
                show_college.Show();

                checker = 1;
                home.Show();
                this.Close();


            }
        }

        private void College_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (checker == 0)
            {

                if (MessageBox.Show("Are you sure to close?", "Yes", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    home.Show();
                }
                else
                {
                    e.Cancel = true;
                }

            }
        }


      
   

        

    
        
      
    }
}
